<?php  
/**
 * 销售
 * @copyright   Copyright (c) 2006 - 2010 DZH 友拓软件友拓通
 * @category   	销售信息
 * @package  	Action
 * @author    	李恺弘
 * @version 	2.1,2012-07-22
 */

class SaleOrderPublicAction extends RelationCommonAction {
	
	
	public function __construct(){
		parent::__construct(); 
		$this->assign('sid',session_id());
		$this->assign('file_tocken',md5(time()));
		if (getUser('role_type')==5) {
			$_POST['query']['a.client_id'] = intval(getUser('company_id'));
		}
	}
	 
	public function alistFinish(){   
		$this->_autoIndex('index');
	}
	
	public function alistUnfinish(){ 
		$this->_autoIndex('index');
	}  
	
	/// 查看明细
	public  function quicklyShowSaleType() {	 
		$id	=	intval($_GET['id']);	 
		if ($id> 0) {  
			///获取当前Action名称
			$model 		= $this->getModel();  
			$this->id	= $id;
			$model->setId($id);
			$this->list	= $model->quicklyShowSaleType();	  	
		} else {
			$this->error(L('_ERROR_ACTION_'));
		}				 	
	}
	
	public function _after_quicklyShowSaleType($temp_file){
		if (empty($temp_file)){ 
			$temp_file	=	empty($this->_Member)?ACTION_NAME:$this->_Member.ACTION_NAME;  
		}  
		$this->display($temp_file);
	}
	
	
	/**
	 * email发送的对象 例如销售单给客户 入库单发送给多个厂家
	 *
	 * @param array $info
	 * @return array
	 */
	public function flowEmailInfo($info){
		if ($info['id']>0){
			$model	=	M('sale_order');
			return $model->where('id='.$info['id'])->select();
		} 
	}
	
}
?>